<?php

/**
 * Publisher form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BasePublisherForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'publisher_id'  => new sfWidgetFormInputHidden(),
      'account_id'    => new sfWidgetFormPropelChoice(array('model' => 'Account', 'add_empty' => false)),
      'created'       => new sfWidgetFormDateTime(),
      'modified'      => new sfWidgetFormDateTime(),
      'business_name' => new sfWidgetFormInput(),
      'email'         => new sfWidgetFormInput(),
      'support_email' => new sfWidgetFormInput(),
      'disabled'      => new sfWidgetFormInput(),
      'support_host'  => new sfWidgetFormInput(),
      'support_user'  => new sfWidgetFormInput(),
      'support_pass'  => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'publisher_id'  => new sfValidatorPropelChoice(array('model' => 'Publisher', 'column' => 'publisher_id', 'required' => false)),
      'account_id'    => new sfValidatorPropelChoice(array('model' => 'Account', 'column' => 'account_id')),
      'created'       => new sfValidatorDateTime(array('required' => false)),
      'modified'      => new sfValidatorDateTime(array('required' => false)),
      'business_name' => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'email'         => new sfValidatorString(array('max_length' => 128)),
      'support_email' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
      'disabled'      => new sfValidatorInteger(),
      'support_host'  => new sfValidatorString(array('max_length' => 128, 'required' => false)),
      'support_user'  => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'support_pass'  => new sfValidatorString(array('max_length' => 16)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Publisher', 'column' => array('account_id')))
    );

    $this->widgetSchema->setNameFormat('publisher[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Publisher';
  }


}
